<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加信息</title>
    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script src="../angular/angular.js"></script>
    <script src="../js/add.js"></script>
</head>
<body ng-app="myApp">
    <div ng-controller="addController" class="container">

        <div class="col-lg-4">
            <form name="addform">
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" class="form-control" id="username" name="username"  ng-model="user.username" required>
                <label ng-show="addform.username.$error.required">用户名不允许为空</label>
            </div>
            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" class="form-control" id="password" name="password"  ng-model="user.password" required>
                <label ng-show="addform.password.$error.required">密码不允许为空</label>
            </div>

            <div class="form-group">
                <label for="nickname">昵称</label>
                <input type="text" class="form-control" id="nickname" name="nickname"  ng-model="user.nickname" required>
                <label ng-show="addform.nickname.$error.required">昵称不允许为空</label>
            </div>
            <button type="button" class="btn btn-default" ng-click="add(user)">添加</button>
            </form>
            user = {{user | json}} <br>
            adduser = {{ adduser | json}}
        </div>
        <div class="col-lg-4">

        </div>
        <div class="col-lg-4">

        </div>


    </div>
</body>
</html>